package org.openmore.consumer.shiro;

import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authc.pam.ModularRealmAuthenticator;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * Created by michaeltang on 2019/3/7.
 */
public class DefaultModularRealm extends ModularRealmAuthenticator {

    @Autowired
    private UserRealm userRealm;
    /**
     * 判断登录类型执行操作
     */
    @Override
    protected AuthenticationInfo doAuthenticate(AuthenticationToken authenticationToken) throws AuthenticationException {
        return this.doSingleRealmAuthentication(userRealm, authenticationToken);
    }
}
